/**
 * We are in the game now!
 */
#ifndef GAME_H_
#define GAME_H_

#include "main.h"
#include "network.h"
#include "world/map.h"

#ifdef TARGET_CLIENT
extern int game_my_player;
#endif

typedef struct {
	unsigned long seed; // the value from which the game content was generated
	int game_time;      // in ticks passed since game start
	Map map;
	Player player [MAX_PLAYERS];
	int n_players;
} Game;

extern Game the_game; // TODO: maybe kill this obnoxious global variable

/*
 * Called at the start of the game, when switching from
 * any application state to STATE_GAME.
 */
void game_init ();

/*
 * Prepares the game with meta-info from the lobby phase
 * where clients register their players and characters.
 * 
 * NOTE: game_seed is called before game_init,
 *       while the application is still in STATE_LOBBY!
 */
void game_seed (unsigned long seed, int n_characters);

void game_update ();
void game_draw ();

/*
 * Releases resources used by the ingame state.
 */
void game_cleanup ();

#endif
